<% content_for(:header) do %>
  <script type="text/javascript">//<![CDATA[
    var xed;
    window.onload = function() {
        xed = new xq.Editor($("page_source"));
        xed.config.imagePathForDefaultToobar = '/images/toolbar/';
        xed.setEditMode('source');
        xed.loadStylesheet("/stylesheets/xq_contents.css");
        // xed.getFrame().style.width = "100%";
      //  xed.getFrame().style.height = "400px";
        xed.focus();
    }
    //]]></script>
<% end %>
    
<h1>Editing page</h1>

<%= error_messages_for :page %>

<% form_for(:page, :url => page_path(@page), :html => { :method => :put }) do |f| %>
  <p>
    <strong>Title</strong><br />
    <%= f.text_field :title %>
  </p>

  <p>
    <strong>Source</strong>
  </p>
  <div><%= f.text_area :source %></div>

  <p>
  <%= check_box_tag('code', 'true', false) %>
    <%= submit_tag "Update" %>
  </p>
<% end %>

<%= link_to 'Show', page_path(@page) %> |
<%= link_to 'Back', pages_path %>